<template>
  <div class="welcome">
      欢迎来接口测试平台
      <el-link type="primary" @click="getHelpFile" v-if="false">接口自动化平使用手册.docx</el-link>
  </div>
</template>

<script>
import { getHelpFile } from "@/network/networks";
export default {

  methods: {
    getHelpFile() {
       getHelpFile()
      .then(response=>{
        let blob = new Blob([response.data]);
        // console.log(re)
        let fileNameEncode = response.headers['content-disposition'].split("filename=")[1]
        let fileName = decodeURIComponent(fileNameEncode);
        if (window.navigator.msSaveOrOpenBlob) {
          navigator.msSaveBlob(blob, fileName);
        } else {
          var link = document.createElement("a");
          link.href = window.URL.createObjectURL(blob);
          link.download = fileName;
          link.click();
          //释放内存
          window.URL.revokeObjectURL(link.href);
        }
      });
    },

  },
}
</script>

<style lang="less" scoped>

</style>